var n = new (require("../../utils/http").HTTP);
Page({
  data: {
    loginOK: !1,
    guanzhu: !1,
    genjin: !1,
    login: !1,
    name: ""
  },
  onShareAppMessage: function () {
    return {
      title: "青澜实业",
      path: "pages/login/login"
    }
  },
  denglu: function () {
    wx.navigateTo({
      url: "./login/login"
    })
  },
  nuguanzhu: function () {
    wx.showToast({
      title: "暂无关注",
      icon: "none",
      duration: 1500
    })
  },
  nugenjin: function () {
    wx.showToast({
      title: "暂无跟进",
      icon: "none",
      duration: 1500
    })
  },
  tuichu: function () {
    wx.clearStorageSync("user"),
      wx.redirectTo({
        url: "/pages/my/login/login"
      })
  },
  
  toQlsj() {
    let user = wx.getStorageSync('user')
    wx.navigateToMiniProgram({
      appId: 'wxbba0d5e590dc9cfa',
      path: 'pages/login/login',
      extraData: {
        username: user[5],
        password: user[6]
      },
      success(res) {
        console.log(res)
      }
    })
  },
  guanzhu: function () {
    wx.navigateTo({
      url: "/pages/my/concern/concern"
    })
  },
  genjin: function () {
    wx.navigateTo({
      url: "/pages/my/through/through"
    })
  },
  jfBtn: function () {
    0 == this.data.integral ? wx.showToast({
      title: "暂无积分",
      icon: "none"
    }) : wx.navigateTo({
      url: "/pages/my/integral/integral"
    })
  },
  loginBtn: function () {
    wx.navigateTo({
      url: "/pages/my/record/record"
    })
  },
  operation() {
    wx.downloadFile({
      url: 'https://www.qlsyyun.com:3000/upload/%E6%93%8D%E4%BD%9C%E6%89%8B%E5%86%8C.pdf', //仅为示例，并非真实的资源
      success(res) {
        console.log(res)
        wx.openDocument({
          filePath: 'https://www.qlsyyun.com:3000/upload/%E6%93%8D%E4%BD%9C%E6%89%8B%E5%86%8C.pdf',
          success: function (res) {
            console.log('打开文档成功')
          }
        })
      },
      complete(res) {
        wx.showModal({
          title: '1',
          content: res.errMsg,
          complete: (res) => {
            if (res.cancel) {

            }

            if (res.confirm) {

            }
          }
        })
      },
    })
  },
  onLoad: function () {
    var t = this,
      a = wx.getStorageSync("avatarUrl"),
      e = wx.getStorageSync("user");
    e[4] > 8 && t.setData({
      login: !0
    }),
      t.setData({
        mobile: e[5],
        user: e,
        avatarUrl: a,
        names: e[0],
        bm: e[1],
        auth: e[4]
      }),
      n.request({
        url: "https://www.qlsyyun.com:3030/clock/get",
        data: {
          arr: 1,
          zsy: t.data.names
        }
      }).then((function (n) {
        console.log(n.data, "data"),
          null == n.data[0].jifen ? t.setData({
            integral: 0
          }) : t.setData({
            integral: n.data[0].jifen
          })
      }))
  }
});